<include file="Public/common" />
<block>
    <link rel="stylesheet" href="__STATIC__/layui/css/layui.css"  media="all">
    <style>
        .col-xs-3{margin-top:5px;}
        th{text-align: center;}
    </style>
</block>
<block name="content">
    <div class="page-header"><h1>首页 &gt;商家管理 > 酒店供应商 >产品列表</h1></div>
    <form action="" method="get">
        <input type="hidden" name="id" value="{:I('id')}">
        <div class="col-xs-12 ">

            <div class="col-xs-3">
                <label for="" class="col-xs-4">供应商名称:</label>
                <div class="col-xs-8 text-left"><input type="text" name="supplier_name" value="{$post.supplier_name}" class="form-control" placeholder="请输入运营商名称" /></div>
             </div>


            <div class="col-xs-3">
                <label for="" class="col-xs-4">编号:</label>
                <div class="col-xs-8 text-left"><input type="text" name="product_sn" value="{$post.product_sn}" class="form-control" placeholder="商品编号" /></div>
            </div>




            <div class="col-xs-3">
                <label for="" class="col-xs-4">星级:</label>
                <div class="col-xs-8 text-left">
                    <select name="star_level" class="form-control" id="">
                        <option value="">全部</option>
                        <option value="1" <if condition="$post['star_level'] eq 1">selected</if>  >一星</option>
                        <option value="2" <if condition="$post['star_level'] eq 2">selected</if> >二星</option>
                        <option value="3" <if condition="$post['star_level'] eq 3">selected</if> >三星</option>
                        <option value="4" <if condition="$post['star_level'] eq 4">selected</if> >四星</option>
                        <option value="5" <if condition="$post['star_level'] eq 5">selected</if> >五星</option>
                    </select>
              </div>
            </div>

            <div class="col-xs-3">
                <label for="" class="col-xs-4">审核状态:</label>
                <div class="col-xs-8 text-left">
                    <select name="is_review" id="is_review" class="form-control">
                        <option value="">全部</option>
                        <option value="-1" <if condition="$post['is_review'] eq -1">selected</if>>待审核</option>
                        <option value="1" <if condition="$post['is_review'] eq 1">selected</if>>已审核</option>
                    </select>
                </div>
            </div>

            <div class="col-xs-3">
                <label for="" class="col-xs-4">操作人:</label>
                <div class="col-xs-8 text-left">
                    <input type="text" name="entry_id"  value="{$post.entry_id}" class="form-control" placeholder="请输入操作人" />
                </div>
            </div>
            <div class="col-xs-3">
                <button class="btn btn-primary">查询</button>
            </div>
        </div>

        <div class="col-xs-12"  style="margin-top:10px;">
            <if condition="checkAuth('Dealer/Shops/addHotelRoom')">
                <a href="{:U('addHotelRoom',array('supplier_id'=>$post['id']))}" class="btn btn-primary btn-xs pull-right" style="margin-right: 10px">添加产品</a>
            </if>
            <if condition="checkAuth('Dealer/Shops/hotelExportExcelBySupplierId')">
                <a href="{:U('hotelExportExcelBySupplierId',array('supplier_id'=>$post['id']))}" class="btn btn-primary btn-xs pull-right" style="margin-right: 10px">导出</a>
            </if>
        </div>

    </form>

    <table class="table table-striped table-bordered table-hover table-condensed text-center">
        <thead>
            <tr>
                <th class="filtrate_1" >供应商名称 <!--<input type="checkbox" class="checkAll">--></th>
                <th class="filtrate_2" >星级</th>
                <th class="filtrate_3" >编号</th>
                <th class="filtrate_3" >房间</th>
                <th class="filtrate_4" >外币本价</th>
                <th class="filtrate_4" >汇率</th>
                <th class="filtrate_4" >人民币成本价</th>
                <th class="filtrate_7" >操作人</th>
                <th class="filtrate_7" >审核状态</th>
                <th class="filtrate_7" >是否上架</th>
                <th class="filtrate_7"  style="width:180px;">操作</th>
            </tr>
        </thead>
        <tbody>
            <volist name="list" id="vo">
                <tr >
                    <td class="filtrate_1" >{$vo.si_name} <!--<input type="checkbox" class="chk">--></td>
                    <td class="filtrate_2">{$vo.star_level}星</td>
                    <td class="filtrate_3">{$vo.product_sn}</td>
                    <td class="filtrate_3">{$vo.room_name}</td>
                    <td class="filtrate_4">

                        <p>成人:{$vo.adult_foreign_cost}元/人</p>
                         <p>儿童:{$vo.child_foreign_cost}元/人</p>
                    </td>
                    <td>
                        {$vo.exchange_rate}
                    </td>
                    <td>

                        <p>成人:{$vo.adult_actual_cost}元/人</p>
                        <p>儿童:{$vo.child_actual_cost}元/人</p>
                    </td>
                    <td class="filtrate_5">{$vo.sp_name}</td>
                    <td class="filtrate_6">
                        <switch name="vo.is_review">
                            <case value="1">已审核</case>
                            <case value="-1">待审核</case>
                            <case value="-2">被拒</case>
                        </switch>
                    </td>
                    <td class="filtrate_7">
                        <switch name="vo.is_shelves">
                            <case value="1">上架</case>
                            <case value="-1">下架</case>
                        </switch>
                     </td>
                    <td class="filtrate_7">
                        <if condition="checkAuth('Dealer/Shops/editHotelRoom')">
                            <if condition="$vo['is_review'] eq 1">
                                <a href="{:U('editHotelRoom',array('room_priceId'=>$vo['room_priceId'],'supplier_id'=>$post['id']))}" class="btn btn-xs btn-warning">审核</a>
                                <else/>
                                <a href="{:U('editHotelRoom',array('room_priceId'=>$vo['room_priceId'],'supplier_id'=>$post['id']))}" class="btn btn-xs btn-primary">审核</a>
                            </if>
                        </if>

                        <if condition="checkAuth('Dealer/Shops/hotelRoomShelvesById')">
                            <if condition="$vo['is_shelves'] eq 1">
                                <a href="{:U('hotelRoomShelvesById',array('room_priceId'=>$vo['room_priceId'],'is_shelves'=>-1))}" class="btn btn-xs btn-warning">下架</a>
                                <else/>
                                <a href="{:U('hotelRoomShelvesById',array('room_priceId'=>$vo['room_priceId'],'is_shelves'=>1))}" class="btn btn-xs btn-primary">上架</a>
                            </if>
                        </if>


                    </td>
                </tr>
            </volist>
        <tr>
            <td colspan="11">
                <!--分页样式-->
                <ul class="pagination">
                    {$show}
                </ul>
            </td>
        </tr>
        </tbody>
    </table>

</block>
<block name="js">
<script src=""></script>
<script src="__STATIC__/layui/layui.all.js"></script>
<script src="__STATIC__/layui/layui.js"></script>
<script>
/**
 * 打开订单详情页面
 * @param  {[int]}    orderId     [订单id]
 */

//筛选显示
$('body').on('change','.filtrate',function () {
   var id=$(this).val();
   if($(this).is(':checked')){
        $('.filtrate_'+id).show();
   }else{
       $('.filtrate_'+id).hide();
   }
});


layui.use('laydate', function() {
    var laydate = layui.laydate;
    //常规用法
    laydate.render({
        elem: '#end_time'
    });
    laydate.render({
        elem: '#start_time'
    });
})

/**
 *订单详情
 * @param orderId
 */

function openDetail(orderId){
    layer.open({
        type: 2,
        offset:20,
        area: ['90%','90%'],
        title: '订单详情',
        content: '{:U("Orders/detail")}',
    })
}
</script>
</block>
